#include "widget.h"

#include <QKeySequenceEdit>
#include <QDebug>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
    resize(600, 480);

    QKeySequenceEdit *kse = new QKeySequenceEdit(this);
    kse->move(100, 100);

    connect(kse, &QKeySequenceEdit::keySequenceChanged,
            [=](const QKeySequence &ks){
        if(ks == QKeySequence("ctrl+v"))//字符串要注意没有空格,大小写没有关系
        {
            close();
        }
        else
        {
            qDebug() << "快捷方式创建失败";
        }
    });
}

Widget::~Widget()
{
}

